/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.re.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author yun
* @date 2024-02-20
**/
@Entity
@Data
@Table(name="reviews")
public class Reviews implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`re_id`")
    @ApiModelProperty(value = "评论编号")
    private Integer reId;

    @Column(name = "`re_baby`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "选择宝贝")
    private String reBaby;

    @Column(name = "`re_class`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "评价等级")
    private String reClass;

    @Column(name = "`re_user`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "评价人")
    private String reUser;

    @Column(name = "`re_user_img`")
    @ApiModelProperty(value = "用户头像")
    private String reUserImg;

    @Column(name = "`re_content`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "评论内容")
    private String reContent;

    @Column(name = "`re_baby_img`")
    @ApiModelProperty(value = "宝贝图片")
    private String reBabyImg;

    @Column(name = "`re_phone`")
    @ApiModelProperty(value = "联系方式")
    private String rePhone;

    @Column(name = "`re_data`")
    @ApiModelProperty(value = "创建时间")
    private Timestamp reData;

    @Column(name = "`re_code`")
    @ApiModelProperty(value = "状态")
    private String reCode;

    public void copy(Reviews source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
